package factory.abstr;

import factory.Audi;
import factory.Bmw;
import factory.Car;

/**
 * 抽象工厂
 * @author cctv
 */
public abstract class AbstractFactory {
    protected abstract Car getCar();

    public Car getCar(String name){
        if("BMW".equalsIgnoreCase(name)){
            return new BmwFactory().getCar();
        }else if("Audi".equalsIgnoreCase(name)){
            return new AudiFactory().getCar();
        }
        return null;

    }
}
